<?php
	function createMainView($view){
		/*echo json_encode($view->findAll());
		echo "<br>";
		echo json_encode($view);*/

?>
	


	<div>
		<table>
		<caption> Курсы пользователей </caption>
			<thead>
				<tr>
					<th>N</th>
					<th></th>
					<th>Клиент</th>
					<th>Курс</th>
					<th>Дата начала занятий</th>
					<th>Количество занятий</th>
					<th>Преподаватель</th>
					<th>Сумма(стоимость курса)</th>
					<th>Оплата</th>
				</tr>
			</thead>
			<tbody data-bind="foreach:mainView().model">
				<tr>
					<td data-bind="text:row_num"></td>
					<td></td>
					<td data-bind="text:client_name"></td>
					<td data-bind="text:course_name"></td>
					<td data-bind="text:clientcourse_begin"></td>
					
					<td data-bind="text:clientcourse_currentcount"></td>
					<td data-bind="text:teacher_name"></td>
					<td data-bind="text:course_basecost"></td>
					<td data-bind="text:paystatus_name"></td>
				</tr>
			</tbody>
		</table>
	</div>

	<script>
		var __data_main =  <?php  echo json_encode(  $view->findAll()); ?>
	</script>

<?php		
	}
?>